package com.fy.dao;

import com.fy.entity.U_like;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface U_likeMapper {
    @Select("select  *from u_like")
    List<U_like> findAll();

    @Select("select  *from u_like where info_id=#{info_id}")
    List<U_like> getInfo(@Param("info_id")String info_id);

    @Insert("insert into u_like(ku_id, info_id, id, type) VALUES (#{ku_id},#{info_id},#{id},#{type})")
    int insert(@Param("ku_id") String ku_id, @Param("info_id") String info_id,
               @Param("id") String id, @Param("type") String type);

    @Delete("delete from u_like where info_id=#{info_id} and id=#{id} and type=#{type}")
    int delete(@Param("info_id") String info_id, @Param("id") String id,
               @Param("type") String type);

    @Select("select id from  u_like where info_id=#{info_id} and type=#{type}")
    List<String> getId(@Param("info_id")String info_id,@Param("type")String type);
}
